@echo off
set local_dir="source\rttread3p0"
set real_dir="C:\Users\Administrator\Desktop\rtthread\meter_fatfs\rttread3p0"
:repeat
@cls
@echo [1]start tomcat 
@echo [2]stop tomcat
@echo [3]index source
@echo [4]make dir link
@echo [q]quit this program
set /p input=
if {%input%} == {1} goto start_tomcat
if {%input%} == {2} goto stop_tomcat
if {%input%} == {3} goto index
if {%input%} == {4} goto link
if {%input%} == {q} goto quit
goto end
:start_tomcat
@echo start tomcat...
cd /d  ..\apache-tomcat-9.0.12\bin\
start startup.bat
cd /d  ..\..\opengrok-1.1-rc8
goto end
:stop_tomcat
@echo stop tomcat...
cd ..\apache-tomcat-9.0.12\bin
start shutdown.bat
cd /d  ..\..\opengrok-1.1-rc8
goto end
:index
@echo index...
java -Xmx1024m -jar .\lib\opengrok.jar -W ".\data\configuration.xml" -P -S -v -s ".\source" -d ".\data"
goto end
:link
@echo make link...
mklink /j %local_dir% %real_dir%
goto end
:end
pause
goto repeat
:quit
exit

